package com.cms.demo.controller;

import com.cms.demo.entity.vo.UserVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.omg.CORBA.ObjectHelper;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Iterator;
import java.util.Map;
import java.util.Set;

/**
 * @author wangning
 * @create 2021-03-21 19:24
 * @description
 */
@RestController
@Api(value = "用户")
public class UserController {
	@GetMapping("/user")
	@ApiOperation(value = "添加用户", notes = "添加单个用户")
	public String save() {
		return "新增成功";
	}
//	public String save(@RequestBody UserVo user) {
//		return "新增成功";
//	}

	@GetMapping("/hello")
	public void hello(Model model) {
		int i = 1 / 0;
		Map<String, Object> map = model.asMap();
		Set<String> keySet = map.keySet();
		Iterator<String> iterator = keySet.iterator();
		while (iterator.hasNext()) {
			String key = iterator.next();
			Object value = map.get(key);
			System.out.println(key + ">>>>>>" + value);
		}
	}
}
